using System;
using System.Collections.Generic;
using System.Text;

namespace Ghasam.Business.Domain.Entity
{
    public class InternalAccounting
    {

        private int id;
        private InternalAccount account;
        private float? credit;
        private float? debit;
        private Item item;
        private float? quantity;
        private float? unitPrice;
        private long? invoiceNumber;
        private SalesPerson salesPerson;
        private string description;
        private InternalAccountingType accountingType;
        private bool? paid;
        private DateTime? modifyStamp;
        private DateTime? accountingDate;

        public virtual long? InvoiceNumber {
            get { return invoiceNumber; }
            set { invoiceNumber = value; }
        }

        public virtual DateTime? AccountingDate {
            get { return accountingDate; }
            set { accountingDate = value; }
        }

        public virtual DateTime? ModifyStamp
        {
            get { return modifyStamp; }
            set { modifyStamp = value; }
        }

        public virtual bool? Paid
        {
            get { return paid; }
            set { paid = value; }
        }

        public virtual InternalAccountingType AccountingType
        {
            get { return accountingType; }
            set { accountingType = value; }
        }

        public virtual string Description
        {
            get { return description; }
            set { description = value; }
        }

        public virtual SalesPerson SalesPerson
        {
            get { return salesPerson; }
            set { salesPerson = value; }
        }

        public virtual float? UnitPrice
        {
            get { return unitPrice; }
            set { unitPrice = value; }
        }

        public virtual float? Quantity
        {
            get { return quantity; }
            set { quantity = value; }
        }

        public virtual Item Item
        {
            get { return item; }
            set { item = value; }
        }

        public virtual float? Debit
        {
            get { return debit; }
            set { debit = value; }
        }

        public virtual float? Credit
        {
            get { return credit; }
            set { credit = value; }
        }

        public virtual InternalAccount Account
        {
            get { return account; }
            set { account = value; }
        }

        public virtual int Id
        {
            get { return id; }
            set { id = value; }
        }

        public virtual string AccountName
        {
            get {
                string accountName = "";

                if (this.Account != null)
                    accountName = this.Account.Name;

                return accountName; 
            }
        }

        public virtual string SalesPersonName {
            get {
                string salesPersonName = "";

                if (this.SalesPerson != null)
                    salesPersonName = this.SalesPerson.Title;

                return salesPersonName;

            }
        }

        public virtual string ItemDescription {

            get {
                string itemDesc = "";

                if (this.Item != null) {
                    itemDesc = this.Quantity + " " + this.Item.Unit + " " + this.Item.Name;
                }

                return itemDesc;
            }
        }

        public virtual string ItemName
        {
            get
            {
                string itemName = "";

                if (this.Item != null)
                {
                    itemName = this.Item.Name;
                }

                return itemName;
            }
        }

        public virtual string ItemUnit
        {
            get
            {
                string itemUnit = "";

                if (this.Item != null)
                {
                    itemUnit = this.Item.Unit;
                }

                return itemUnit;
            }
        }
    }
}
